package typejump.gui;

import java.awt.Graphics2D;
import java.awt.Rectangle;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;

/**
 * This is the class which is used by the game's Canvas to paint widgets and stuff over the main screen.
 * Eg, health bars, etc.
 * @author g
 *
 */
public interface UIWidget {
	/** Sets the dimensions of the space that this UIWidget can draw on */
	public void setAvailableSpace(int width, int height);
	/** Paints this UIWidget */
	public void paint(Graphics2D g);
	/** Gets the bounding rectangle of this UIWidget */
	public Rectangle getBounds();
	
	/** Returns true if the KeyEvent was consumed (should not be used by further components) */
	public boolean keyEvent(KeyEvent e);
	
	/** Returns true if the MouseEvent was consumed (should not be used by further components) */
	public boolean mouseEvent(MouseEvent e);
}
